const getBiggestNum = (arr) => {
  if (arr.length == 2) {
    return arr[0] > arr[1] ? arr[0] : arr[1];
  } else if (arr.length == 1) {
    return arr[0];
  } else {
    return arr[0] > getBiggestNum(arr.slice(1))
      ? arr[0]
      : getBiggestNum(arr.slice(1));
  }
};

let arr = [1, 3, 99, 7, 9];

console.log(getBiggestNum(arr));
